<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<html lang="en" style="font-size: 53.3333px;">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover">
    <script src="${pageContext.request.contextPath}/script/easygo/jweixin-1.6.0.js"></script>
    <script src="${pageContext.request.contextPath}/script/easygo/commonH5.js"></script>
    <script src="${pageContext.request.contextPath}/script/jquery.js"></script>
    <link href="${pageContext.request.contextPath}/style/css/easygo/about.8d6b7665.css" rel="prefetch">
    <link href="${pageContext.request.contextPath}/style/css/easygo/chunk-vendors.347f43e9.css" rel="preload"
          as="style">
    <link href="${pageContext.request.contextPath}/style/css/easygo/index.105f42f0.css" rel="preload" as="style">
    <link href="${pageContext.request.contextPath}/style/css/easygo/chunk-vendors.347f43e9.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/style/css/easygo/index.105f42f0.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/style/css/easygo/main.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/style/css/easygo/bundleV1_1.css">
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/style/css/easygo/about.8d6b7665.css">
</head>


<body style="">
<style>
    #address {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

</style>

<div id="app">
    <div data-v-d82d9026="" class="wrapper-orderConfirm">
        <div data-v-d82d9026="">
            <div data-v-d82d9026="" rule-sign="address" event-id="getAddressInfo_872QU994" class="section">
                <div class="jz-clean-address" style="height: 1.72rem;">
                    <div class="jz-clean-address__user-info">
                        <div>
                            <div id="address"></div>
                            <div class="jz-clean-address__user-info__desc"><span id="contactName"></span><span
                                    id="mobile"></span>
                            </div>
                        </div>
                    </div>
                    <i class="dj-icon-arrow-right"></i>
                </div>

                <div class="jz-clean-address" style="height: 1.72rem;">
                    <div>请填写服务地址</div>
                    <i class="dj-icon-arrow-right"></i>
                </div>

                <div class="jz-clean-address__address-container">
                    <div class="jz-clean-address__address-border"></div>
                </div>
            </div>
        </div>
        <div data-v-d82d9026="" class="marginTop20">
            <div data-v-5fa28f2b="" data-v-d82d9026="" class="card_warpper">
                <div data-v-5fa28f2b="" class="card">
                    <div data-v-5fa28f2b="" class="card__head">
                        <div data-v-5fa28f2b="" class="head__img"
                             style="background-image: url(&quot;https://www.easygoshanghai.com//easygoshPath/2021/10/26/11757/44b1c516-f863-4132-9f68-7211bb73f79a.jpg&quot;);"></div>
                    </div>
                    <div data-v-5fa28f2b="" class="card__body">
                        <div data-v-5fa28f2b="" class="body__title">日常保洁</div>
                        <div data-v-5fa28f2b="" class="body__desc">已选：单次日常保洁3小时</div>
                        <div data-v-5fa28f2b="" class="body__price__tip">
                            <div data-v-5fa28f2b="" class="price"><span data-v-5fa28f2b="" class="unit">¥</span><span
                                    data-v-5fa28f2b="" class="number">150.0</span></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div data-v-d82d9026="" style="display: inline;">
            <div data-v-d82d9026="" class="dc-coupon line-bottom" event-id="getCouponChange_YUS0Y82D">
                <div>优惠券</div>
                <div class="coupon-right">
                    <div class="price"><span>-5.0元</span>
                        <div class="dc-coupon-tip">本券不能同时享受卡折扣</div>
                    </div>
                    <div class="icon dj-icon-arrow-right"></div>
                </div>
            </div>
        </div>
        <div data-v-d82d9026="" class="marginTop20">
            <div data-v-f90a6b5c="" data-v-d82d9026="" onclick="showSelectDateTime()" class="choose-time"
                 style="height:1.2rem;"
                 event-id="clickTimeItem_8PZZU71D">
                <div data-v-f90a6b5c="" class="name">服务时间</div>
                <div data-v-f90a6b5c="" class="dj-item choose-time--item dj-item-normal dj-item-link dj-item-line"
                     event-id="clickTimeItem_T3K8WRNK">
                    <div class=""></div>
                    <div class="dj-item-body">
                        <div class="dj-item-content">
                            <div class="dj-item-main">

                            </div>
                        </div>
                        <div class="dj-item-side"><span class="dj-item-side-normal">添加服务时间</span><i
                                class="dj-icon-arrow-right"></i></div>
                    </div>
                </div>
            </div>
        </div>
        <div data-v-d82d9026="" class="kindlyReminder">
            温馨提示：天鹅到家是服务平台，暂不支持开具发票，如有需要请与劳动者协商。
        </div>
        <div data-v-d82d9026="">
            <div data-v-d82d9026="" class="dj-footer-buttons is-bottom is-fit-iphonex">
                <button data-v-d82d9026="" class="dj-button dj-button-primary dj-button-large" onclick="pay()"
                        event-id="submit_E6WGRSGJ"><span class="button-text" >点击支付</span>
                </button>
            </div>
        </div>
        <div data-v-d82d9026="" event-id="timeConfirm_JNWQJBBP">
            <div class="date-time-picker" event-id="showDateTimePicker_QARZYHDF">
                <section data-v-f9a920c0="" class="jz-clean-E-popupbox">
                    <div data-v-f9a920c0="" class="mask" style="display: none;"></div>
                    <div data-v-f9a920c0="" class="jz-clean-E-popupbox-panel" style="display: none;">
                        <div data-v-f9a920c0="" class="jz-clean-E-popupbox-container">
                            <div data-v-f9a920c0="" class="jz-clean-E-popupbox-header jz-clean-E-popupbox-header-line"
                                 style="height: 1.2rem;">
                                <div data-v-f9a920c0="" class="jz-clean-E-popupbox-header-title">
                                    选择开始时间
                                </div>
                                <div data-v-f9a920c0="" onclick="closeSelectDateTime()"
                                     class="jz-clean-E-popupbox-header-close">
                                    <img data-v-f9a920c0=""
                                         style="height: .52rem;width: .52rem;"
                                         src=""
                                         alt=""></div>
                            </div>

                            <div data-v-f9a920c0="" class="jz-clean-E-popupbox-content">
                                <div class="time-selector" value="[object Object]">
                                    <div class="time-selector__content">
                                        <div class="time-selector__date">
                                            <ul></ul>
                                        </div>
                                        <div class="time-selector__container">
                                            <div class="time-selector__time">
                                                <div class="time-selector__warpper" style="height: 6.12rem;">

                                                </div>
                                            </div>
                                            <div class="date-time-picker-txt"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div data-v-f9a920c0="" class="jz-clean-E-popupbox-confirm">
                                <div data-v-f9a920c0="" class="dj-footer-buttons">
                                    <button data-v-f9a920c0="" onclick="confirmSelectDateTime()"
                                            class="dj-button dj-button-primary dj-button-large">
                                          <span class="button-text">
                        确定
                      </span></button>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </div>
        <div data-v-d82d9026="" class="dj-loading-normal" style="z-index: 1000; display: none;">
            <div class="dj-loading-con-normal" style="width: 130px;">
                <div class="loading-icon">
                    <div class="circle-normal-box"></div>
                    <div class="normal-loading-logo"></div>
                </div>
                <div class="dj-loading-text">加载中...</div>
            </div>
        </div>
        <div data-v-d82d9026="" class="daily-clean-dailog" event-id="showOrderDialog_U0MZFZWX">
            <div class="dj-popup-container dj-popup-center" event-id="showDailog_AJQ2XBB4" style="display: none;">
                <div class="dj-popup-panel" style="width: 5.4rem; border-radius: 0.16rem; display: none;">
                    <div class="dj-dialog-wrap">
                        <div class="dj-dialog-title">
                            温馨提示
                        </div>
                    </div>
                    <div class="dj-dialog-footer">
                        <button class="dj-button dj-button-default plain dj-button-large" style="height: 0.88rem;">
                              <span class="button-text">

    </span></button>
                        <button class="dj-button dj-button-primary dj-button-large" style="height: 0.88rem;">
                              <span class="button-text">

    </span></button>
                    </div>
                </div>
            </div>
        </div>
        <div data-v-d82d9026="" class="dj-popup-container dj-popup-center" event-id="checkDialog_2R9R5UQ1"
             style="display: none;">
            <div class="dj-popup-panel" style="width: 5.4rem; border-radius: 0.16rem; display: none;">
                <div class="dj-dialog-wrap">
                    <div class="dj-dialog-title">
                        提示
                    </div>
                    <div class="dj-dialog-content" style="text-align: center;">欢迎使用到家服务</div>
                </div>
                <div class="dj-dialog-footer">
                    <button class="dj-button dj-button-primary dj-button-large" style="height: 0.88rem;">  <span
                            class="button-text">
      确认
    </span></button>
                </div>
            </div>
        </div>
    </div>
</div>


<script>

    var memberId = '${memberId}';
    var cleanMode='${cleanMode}';
    var addressId = '599';
    var duration='${duration}';
    var cleanTimes='${cleanTimes}';

    var serviceDate ='${serviceDate}';
    var serviceWeek ='${serviceWeek}';
    var serviceTime ='${serviceTime}';
    var pricePay="1";

    //日期相关参数
    var currentCalendarIndex = "0";
    var dayEnum = ["Sunday", "Monday", "Tuesday", "Wed", "Thursday", "Friday", "Saturday"];
    var timeArray = [
        {"time": "8:00", disable: false},
        {"time": "8:30", disable: false},
        {"time": "9:00", disable: false},
        {"time": "9:30", disable: false},
        {"time": "10:00", disable: false},
        {"time": "10:30", disable: false},
        {"time": "11:00", disable: false},
        {"time": "11:30", disable: false},
        {"time": "12:00", disable: false},
        {"time": "12:30", disable: false},
        {"time": "13:00", disable: false},
        {"time": "13:30", disable: false},
        {"time": "14:00", disable: false},
        {"time": "14:30", disable: false},
        {"time": "15:00", disable: false},
        {"time": "15:30", disable: false},
        {"time": "16:00", disable: false},
        {"time": "16:30", disable: false},
        {"time": "17:00", disable: false},
        {"time": "17:30", disable: false},
        {"time": "18:00", disable: false},
        {"time": "18:30", disable: false},
        {"time": "19:00", disable: false},
        {"time": "19:30", disable: false},
    ]

    $(function () {
        jssdk();

        //回显服务时间
        if(serviceTime!=""){
            $(".dj-item-side-normal").text( serviceWeek+" "+serviceDate+" "+serviceTime);
        }

        $(".time-selector__time--cols").bind("click", function () {
            $(this).parent().parent().parent().find(".selected").removeClass("selected")
            $(this).addClass("selected");
        });

        $(".section").bind("click", function () {
            var route = "${pageContext.request.contextPath}/page/confirmOrder?preffix=easygo&memberId="+memberId +
                "&serviceDate="+serviceDate+"&serviceTime="+serviceTime+"&serviceWeek="+serviceWeek +
                "&cleanMode="+cleanMode+"&duration="+duration +"&cleanTimes="+cleanTimes;
            route = encodeURIComponent(route);
            wx.miniProgram.reLaunch({url: '/pages/address/list/list?route=' + route})
        });

        if (addressId == "") {
            $($(".section").find(".jz-clean-address").get(0)).hide();
            $($(".section").find(".jz-clean-address").get(1)).show();
        } else {
            getAddressInfo();
            $($(".section").find(".jz-clean-address").get(1)).hide();
            $($(".section").find(".jz-clean-address").get(0)).show();
        }

    });

    function initDate() {
        var dataSeleced = $(".time-selector__date .selected");
        if (dataSeleced.length == 0) {
            for (let i = 0; i <= 6; i++) {
                var d = getDateStr(i);
            }
            var dataSeleced = $(".time-selector__date .selected");
            if (dataSeleced.length == 0) {
                var div = $(".time-selector__date li :first");
                div.parent().find("em").text("today");
                div.addClass("selected");
            }

            initSeleteTime();
        }
    }

    function getDateStr(dayNum) {
        var dd = new Date();
        dd.setDate(dd.getDate() + dayNum);
        var y = dd.getFullYear();
        var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1);
        var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();

        var day = dd.getDay();
        var week = dayEnum[day];
        var date = m + "-" + d;
        var jsonDate = {
            date: date,
            week: week
        };

        var div="";
        if(serviceDate==date){
            div=div+"<li><div class='time-selector__date__item selected' onclick='selectedDateItem(this)'>" ;
        }else{
            div=div+"<li><div class='time-selector__date__item' onclick='selectedDateItem(this)'>" ;
        }
        div=div+"<span class='time-selector__date__item--week'><em>"+week+"</em> </span>";
        div=div+ "<p><span class='time-selector__date__item--date'>"+date+"</span></p></div></li>";
        var dateLi = $(".time-selector__date ul").append(div);
    }

    function selectedDateItem(obj) {
        $(obj).parent().parent().find(".selected").removeClass("selected");
        $(obj).addClass("selected");
        initSeleteTime();
    }

    function initSeleteTime() {
        var currentTimeIndex = "100";
        var exist = $(".time-selector__date li :first").hasClass("selected");
        if (exist > 0) {
            var dd = new Date();
            var h = dd.getHours();
            for (var i = 0; i < timeArray.length; i++) {
                var hours = timeArray[i].time.split(":")[0];
                if (h > hours - 1) {
                    timeArray[i].disable = true;
                } else {
                    timeArray[i].disable = false;
                    if (i < currentTimeIndex) {
                        currentTimeIndex = i;
                    }
                }
            }
        } else {
            for (var i = 0; i < timeArray.length; i++) {
                timeArray[i].disable = false;
                currentTimeIndex = "0";
            }

        }

        $(".time-selector__warpper").empty();
        for (i = 0; i < 6; i++) {
            var rows = "<div class='time-selector__time--rows'>";
            for (j = 0; j < 4; j++) {
                var time = timeArray[i * 4 + j].time;
                var disable = timeArray[i * 4 + j].disable;
                var cols = "";
                if (disable) {
                    cols = "<div class='disabled time-selector__time--cols'>" +
                        "<div class='time-selector__time--con'><span>" + time + "</span>" +
                        "<span class='time-selector__time--secondType-fee'></span>" +
                        "<span>Full</span></div></div>";
                } else {
                    if(serviceTime==time){
                        cols = "<div class='time-selector__time--cols selected' onclick='selectedTime(this)'>";
                    }else{
                        cols = "<div class='time-selector__time--cols' onclick='selectedTime(this)'>";
                    }
                    cols =cols+ "<div class='time-selector__time--con'><span class='time'>" + time + "</span>" +
                        "<span class='time-selector__time--secondType-fee'></span>" +
                        "</div></div>";

                }
                rows = rows + cols;
            }
            rows = rows + "</div>";
            $(".time-selector__warpper").append(rows);
        }
    }

    function selectedTime(obj) {
        $(obj).parent().parent().find(".selected").removeClass("selected");
        $(obj).addClass("selected");
    }

    function showSelectDateTime() {
        $(".mask").css('display', 'inline');
        $(".jz-clean-E-popupbox-panel").css('display', 'inline');
        initDate();
    }

    function closeSelectDateTime() {
        $(".mask").css('display', 'none');
        $(".jz-clean-E-popupbox-panel").css('display', 'none');
    }

    function confirmSelectDateTime() {
        serviceWeek = $(".time-selector__date").find(".selected").find("em").text();
        serviceDate = $(".time-selector__date").find(".selected").find(".time-selector__date__item--date").text();
        serviceTime = $(".time-selector__warpper").find(".selected").find(".time").text();
        if (serviceTime == "") {
            var toast = '<div class="dj-toast positionMiddle" style=""><div class="dj-toast-con dj-toast-normal"><p>Please Choose Time</p></div></div>';
            $("body").append(toast);
            setInterval(function () {
                $(".positionMiddle").remove();
            }, 3000);
        } else {
            this.closeSelectDateTime();
            $(".dj-item-side-normal").text( serviceWeek+" "+serviceDate+" "+serviceTime);
        }
    }


    function getAddressInfo() {
        var param = {
            addressId: addressId,
            "method": "getAddressInfo"
        };
        var url = "${pageContext.request.contextPath}/api/apiSecurityController";
        $.ajax({
            url: url,
            type: "POST",
            async: true,
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(param),
            dataType: 'json',
            success: function (data) {
                if (data.resultCode == "000000") {
                    data = data.data;
                    var mobile = data.mobile;
                    var contactName = data.contactName;
                    var address = JSON.parse(data.centerData).title;
                    $("#mobile").text(mobile);
                    $("#contactName").text(contactName);
                    $("#address").text(address);
                } else {
                    alert(data.resultMsg)
                }
            }
        });

    }

    function pay() {
        // var toast = '<div class="dj-toast positionMiddle" style=""><div class="dj-toast-con dj-toast-normal"><p>不能支付，未开通H5支付</p></div></div>';
        // $("body").append(toast);
        // setInterval(function () {
        //     $(".positionMiddle").remove();
        // }, 5000);
        // unifiedOrderH5();

        createJSAPI();

        // serviceAddOrUpdate();
    }



    function serviceAddOrUpdate() {
        var time = new Date().getTime();
        var outTradeNo = "ey" + time;

        var data = {};
        data.method = "serviceAddOrUpdate";
        data.outTradeNo = outTradeNo;
        data.memberId = memberId;
        data.serviceType = "2"; //类型 1搬家 2阿姨 3家庭维修 4通下水 5开锁 6卫星电视 7装宽带 8送水
        data.serviceName = "Ayi";

        data.serviceDate = serviceDate;
        data.serviceTime = serviceTime;
        data.serviceWeek = serviceWeek;
        data.addressId = addressId;
        data.addressId2 = "";
        data.details = "";
        data.wechat = "";
        data.mobile = "";
        data.price = pricePay;
        data.floor = "";
        data.floor2 = "";
        data.duration=duration;
        data.cleanMode = cleanMode;
        data.outTradeNo= outTradeNo;
        data.modeType = "service";


        var serviceId = "663";
        var orderParam = {};
        orderParam.goodsId = "";
        orderParam.serviceId = "663";
        orderParam.memberId = memberId;
        orderParam.addressId = "";
        orderParam.itemId = "";
        orderParam.ticketId = "";
        orderParam.priceTotal = pricePay;
        orderParam.pricePay =  pricePay;
        orderParam.priceDiscount = 0;
        orderParam.remark = "";
        orderParam.modeType = "service";
        orderParam.outTradeNo = outTradeNo;
        orderParam.serviceType = "2"; //clean服务

        var route = "${pageContext.request.contextPath}/page/cleanMain?preffix=easygo&orderParam="+orderParam;
        route = encodeURIComponent(route);
        wx.miniProgram.reLaunch({url: '/pages/h5pay/h5pay?route=' + route})
        // wx.miniProgram.reLaunch({url: '/pages/address/list/list?route=' + route})

        <%--var url = "${pageContext.request.contextPath}/api/apiSecurityController";--%>
        <%--$.ajax({--%>
        <%--    url: url,--%>
        <%--    type: "POST",--%>
        <%--    async: true,--%>
        <%--    contentType: "application/json; charset=utf-8",--%>
        <%--    data: JSON.stringify(data),--%>
        <%--    dataType: 'json',--%>
        <%--    success: function (data) {--%>
        <%--        if (data.resultCode == "000000") {--%>
        <%--            var serviceId = data.data.serviceId;--%>
        <%--            var orderParam = {};--%>
        <%--            orderParam.goodsId = "";--%>
        <%--            orderParam.serviceId = serviceId;--%>
        <%--            orderParam.memberId = memberId;--%>
        <%--            orderParam.addressId = "";--%>
        <%--            orderParam.itemId = "";--%>
        <%--            orderParam.ticketId = "";--%>
        <%--            orderParam.priceTotal = pricePay;--%>
        <%--            orderParam.pricePay =  pricePay;--%>
        <%--            orderParam.priceDiscount = 0;--%>
        <%--            orderParam.remark = "";--%>
        <%--            orderParam.modeType = "service";--%>
        <%--            orderParam.outTradeNo = outTradeNo;--%>
        <%--            orderParam.serviceType = "2"; //clean服务--%>
        <%--    --%>
        <%--            var route = "${pageContext.request.contextPath}/page/cleanMain?preffix=easygo&orderParam="+orderParam;--%>
        <%--            route = encodeURIComponent(route);--%>
        <%--            wx.miniProgram.reLaunch({url: '/pages/h5pay/h5pay?route=' + route})--%>
        <%--        } else {--%>
        <%--            alert(data.resultMsg)--%>
        <%--        }--%>
        <%--    }--%>
        <%--});--%>

    }



    function unifiedOrderH5() {
        var param = {
            "method": "unifiedOrderH5"
        };
        var url = "${pageContext.request.contextPath}/api/apiSecurityController";
        $.ajax({
            url: url,
            type: "POST",
            async: true,
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(param),
            dataType: 'json',
            success: function (data) {
                console.log(data)
                if (data.resultCode == "000000") {
                    //后台返回调起微信支付的链接，直接跳转过去即可
                    window.location.href=data.data;
                } else {
                    alert(data.resultMsg)
                }
            }
        });
    }

    function createJSAPI() {
        var time = new Date().getTime();
        var outTradeNo = "ey" + time;
        var param = {
            "total_fee":"1",
            "out_trade_no":outTradeNo,
            "openid":"oXEwa40kJMxSs-GVSra7EfjVopRo",
            "method": "createJSAPI"
        };
        var url = "${pageContext.request.contextPath}/api/apiSecurityController";
        $.ajax({
            url: url,
            type: "POST",
            async: true,
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(param),
            dataType: 'json',
            success: function (data) {
                console.log(data)
                if (data.resultCode == "000000") {
                    var reqData=data.data;
                    if (typeof WeixinJSBridge == "undefined"){
                        if( document.addEventListener ){
                            document.addEventListener('WeixinJSBridgeReady', onBridgeReady(reqData), false);
                        }else if (document.attachEvent){
                            document.attachEvent('WeixinJSBridgeReady', onBridgeReady(reqData));
                            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(reqData));
                        }
                    }else{
                        onBridgeReady(reqData);
                    }
                } else {
                    alert(data.resultMsg)
                }
            }
        });
    }

    function onBridgeReady(data){
        wx.chooseWXPay({
            // 支付签名时间戳，注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
            timestamp: data.timeStamp,
            // 支付签名随机串，不长于 32 位
            nonceStr: data.nonceStr,
            // 统一支付接口返回的prepay_id参数值，提交格式如：prepay_id=\*\*\*）
            package: data.package,
            // 签名方式，默认为'SHA1'，使用新版支付需传入'MD5'
            signType: data.signType,
            // 支付签名
            paySign: data.paySign,
            // 支付成功后的回调函数
            success: function (res) {
                // res.errMsg === 'chooseWXPay:ok'方式判断前端返回,微信团队郑重提示：
                // res.errMsg将在用户支付成功后返回ok，但并不保证它绝对可靠， 切记。
                alert("res->"+JSON.stringify(res));
            },
            // 支付取消回调函数
            cancel: function (res) {
            },
            // 支付失败回调函数
            fail: function (res) {
                alert("res->"+JSON.stringify(res));
            }
        })




        // wx.miniProgram.requestPayment({
        //     timeStamp: param.timeStamp,
        //     nonceStr: param.nonceStr,
        //     package: param.package,
        //     signType: param.signType,
        //     paySign: param.paySign,
        //     success: res => {
        //         console.log("wx.requestPayment返回信息", res);
        //         alert("res->"+JSON.stringify(res));
        //     },
        //     fail: res => {
        //         alert("res->"+JSON.stringify(res));
        //         console.log("支付失败");
        //     },
        //     complete: res => {
        //         console.log("支付完成(成功或失败都为完成)");
        //     }
        // })




        // WeixinJSBridge.invoke(
        //     'getBrandWCPayRequest', {
        //         "appId": reqData.appId,
        //         "timeStamp": reqData.timeStamp,
        //         "nonceStr": reqData.nonceStr,
        //         "package": reqData.package,
        //         "signType": reqData.signType,
        //         "paySign": reqData.paySign
        //     },
        //     function(res){
        //         alert("res->"+JSON.stringify(res));
        //         if (res.err_msg == "get_brand_wcpay_request:ok") {
        //             // alert("支付成功");
        //             WeixinJSBridge.call('closeWindow');
        //         } else {
        //             // alert("res->"+JSON.stringify(res));
        //             WeixinJSBridge.call('closeWindow');
        //         }
        //     });
    }
</script>
</body>
</html>